package day0328;

import java.util.ArrayList;

//数组求长度：数据名.length;       String数据求长度   字符串.length();      集合求元素个数   集合名.size();
public class Test7 {


    public static void main(String[] args) {
        //1.创建一个cards1集合//泛型<Integer>： 用来规定集合cards1中只能存储整数
        ArrayList<Integer> cards1 = new ArrayList<Integer>();
        cards1.add(1);
        cards1.add(2);
        //cards1.add("你");


        int[]   cards2=new int[3];
        cards2[0]=1;
        cards2[1]=2;
        System.out.println(cards2[0]);
        System.out.println(cards2.length);
    }
}
